{% extends "/home/steveswanson/webapps/django/myuwaterloo/templates/home.html" %}
{%block title%}Login / Registration{%endblock%}

{% block content %}


  
  {%if user.is_authenticated%}
	<p> Welcome, {{user.username}}. You are already logged in!</p>
  {% else %}
	<div id="content" class="c clear_children1">

	  <div id="login_left" class = "sc1">
			<h2 id="login">Existing Users</h2>
			 
			 {% if form.errors %}
				<p class="error">Sorry, that's not a valid username or password</p><br>
			 {% endif %}
			  
			<form action='/accounts/login/' method='post'>
					<p>
						Login with your username<br> If you have already registered, please login
					</p>
					<br>
					<p>
						<label id="login" for="username">Username:</label>
						<input type="text" name="username" value="" id="username"/>
					</p>
					<br>
					<p>
					<label id="login" for="password">Password:</label>
					<input type="password" name="password" value="" id="password"/>
					<br>
					</p>

					<input type="submit" value="Login" id="stylized" />
					<input type="hidden" name="next" value="/search/" />
					<br>
			</form>
	</div>
	<div id="login_right" class="pc1 cc_tallest1">
		    <h2 id="login">Register</h2>
			<form action="/register/" method="post" id='login'>
					<br>
					<p>

					<label id="login" for="id_username">Username:</label>  {{ form.username }}
					</p>
					<br>

					<p >

					<label id="login" for="id_password1">Password:</label>
					<input type="password" name="password1" value="" id="password"/>
					 </p>
					 <br>
					 <p>

				    <label id="login" for="id_password2">Password (again):</label>
					<input type="password" name="password2" value="" id="password"/>
					</p>
					<br>
					<p>

					<label id="login" for="id_email">E-mail Address</label> 
					<input class="login"  type="email" name="email" value="" id="email" />
					</p>
					<br>
					<input type="submit" id="stylized" value="Create the account" />
					
			</form>
	</div>
	</div>
	{%endif%}

{% endblock %}
